<?php
 /*
  *总后台品牌模型类
  */
namespace Home\Model; 
use Think\Model;
class BrandModel extends Model
{
		
		public function index($arg=array())
		{
			$arg['keywords']=$arg['keywords'];
			$condition=' 1=1 ';
			if(!empty($arg['keywords']))
			{
				$condition.=' AND  brandname like \'%'.$arg['keywords'].'%\'';
			}
			
			$sql="select brandid,brandname,FROM_UNIXTIME(createtime, '%Y-%m-%d') as createtime from ".C(DB_PREFIX).'brand where'.$condition;
			
			$brands=M()->query($sql);

			return $brands;
			
		}
}